class RmethodsController < ApplicationController
  # GET /rmethods
  # GET /rmethods.xml
  def index
    @rmethods = Rmethod.find(:all)

    respond_to do |format|
      format.html # index.rhtml
      format.xml  { render :xml => @rmethods.to_xml }
    end
  end

  # GET /rmethods/1
  # GET /rmethods/1.xml
  def show
    @rmethod = Rmethod.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
      format.xml  { render :xml => @rmethod.to_xml }
    end
  end

  # GET /rmethods/new
  def new
    @rmethod = Rmethod.new
  end

  # GET /rmethods/1;edit
  def edit
    @rmethod = Rmethod.find(params[:id])
  end

  # POST /rmethods
  # POST /rmethods.xml
  def create
    @rmethod = Rmethod.new(params[:rmethod])

    respond_to do |format|
      if @rmethod.save
        flash[:notice] = 'Rmethod was successfully created.'
        format.html { redirect_to rmethod_url(@rmethod) }
        format.xml  { head :created, :location => rmethod_url(@rmethod) }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @rmethod.errors.to_xml }
      end
    end
  end

  # PUT /rmethods/1
  # PUT /rmethods/1.xml
  def update
    @rmethod = Rmethod.find(params[:id])

    respond_to do |format|
      if @rmethod.update_attributes(params[:rmethod])
        flash[:notice] = 'Rmethod was successfully updated.'
        format.html { redirect_to rmethod_url(@rmethod) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @rmethod.errors.to_xml }
      end
    end
  end

  # DELETE /rmethods/1
  # DELETE /rmethods/1.xml
  def destroy
    @rmethod = Rmethod.find(params[:id])
    @rmethod.destroy

    respond_to do |format|
      format.html { redirect_to rmethods_url }
      format.xml  { head :ok }
    end
  end
end
